Skip to content

Conversation

@MehrazRumman
Copy link
Contributor

@MehrazRumman MehrazRumman commented Jan 5, 2026

Type of Changes

Type
🐛 Bug fix

Description

Closes #10791

This PR updates the behavior of the W1514 (unspecified-encoding) warning to account for
changes introduced by PEP 686.

Starting with Python 3.15, UTF-8 becomes the default text encoding, making the absence of
an explicit encoding= argument safe and predictable. As a result, emitting W1514 by
default for Python 3.15+ produces unnecessary false positives.

What this PR does

  • Keeps W1514 enabled by default for Python versions < 3.15
  • Disables W1514 by default for Python >= 3.15
  • Preserves backward compatibility for older Python interpreters

This reduces noise for users targeting modern Python versions while maintaining safety
checks for older environments.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this !

@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code backport maintenance/4.0.x labels Jan 5, 2026
@Pierre-Sassoulas Pierre-Sassoulas added this to the 4.0.5 milestone Jan 5, 2026
@Pierre-Sassoulas Pierre-Sassoulas changed the title Trying to fix issue #10791 Disable unspecified-encoding for py-version above Python 3.15 Jan 5, 2026
@MehrazRumman MehrazRumman marked this pull request as draft January 5, 2026 18:06
@MehrazRumman
Copy link
Contributor Author

Thanks for the fast review @Pierre-Sassoulas ! Once finished with the optimal version of the PR, I will request for re-review! Thanks again !

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.98%. Comparing base (4f6c241) to head (2ca7c73).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10800   +/-   ##
=======================================
  Coverage   95.98%   95.98%           
=======================================
  Files         176      176           
  Lines       19564    19566    +2     
=======================================
+ Hits        18779    18781    +2     
  Misses        785      785           
Files with missing lines Coverage Δ
pylint/checkers/stdlib.py 96.33% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@MehrazRumman MehrazRumman marked this pull request as ready for review January 10, 2026 08:53
@MehrazRumman
Copy link
Contributor Author

Though its my first PR in this package! Need to explore a lot, I will love to work on other issues as well !

@github-actions

This comment has been minimized.

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! Just two comments :)

@DanielNoord DanielNoord enabled auto-merge (squash) January 11, 2026 12:02
@MehrazRumman
Copy link
Contributor Author

MehrazRumman commented Jan 11, 2026

Thanks @DanielNoord ! & @Pierre-Sassoulas , I will love to work more on this project !

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great merge request !

@DanielNoord DanielNoord merged commit de75d30 into pylint-dev:main Jan 11, 2026
44 checks passed
pylint-backport bot pushed a commit that referenced this pull request Jan 11, 2026
@github-actions
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 2ca7c73

DanielNoord pushed a commit that referenced this pull request Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport maintenance/4.0.x False Positive 🦟 A message is emitted but nothing is wrong with the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable by default W1514 unspecified-encoding starting Python 3.15

3 participants